<template>
    <view class="grace-fixed-msg" :style="'width:' + (width + 'rpx') + '; bottom:' + (bottom + 'rpx')" v-if="show" @tap.stop.prevent="tapme">
        <text class="grace-fixed-msg-icon msg-icon" :style="'color:' + color + ';'"></text>
        <text class="grace-fixed-msg-text" :style="'color:' + color">{{ msg }}</text>
        <text class="grace-fixed-msg-icon msg-right" :style="'color:' + color"></text>
    </view>
</template>

<script>
export default {
    data() {
        return {};
    },
    props: {
        msg: {
            type: String,
            default: ''
        },
        color: {
            type: String,
            default: '#008CFF'
        },
        width: {
            type: Number,
            default: 300
        },
        bottom: {
            type: Number,
            default: 80
        },
        show: {
            type: Boolean,
            default: true
        }
    },
    methods: {
        tapme: function () {
            this.$emit('tapme');
        }
    },
    created: function () {}
};
</script>
<style>
.grace-fixed-msg {
    width: 300rpx;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    padding: 18rpx 20rpx;
    border-radius: 50rpx;
    background: #4e4c4f;
    box-shadow: 0px 0px 16rpx #d5d6d8;
    position: fixed;
    bottom: 60rpx;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    opacity: 0.8;
}
.grace-fixed-msg-icon {
    width: 36rpx;
    height: 36rpx;
    line-height: 36rpx;
    font-size: 30rpx;
    color: #fff;
    flex-shrink: 0;
    opacity: 0.8;
    text-align: center;
}
.msg-icon,
.msg-right {
    font-family: 'grace-iconfont' !important;
}
.msg-icon:before {
    content: '\e666';
}
.msg-icon {
    font-family: 'grace-iconfont' !important;
}
.msg-right:before {
    content: '\e601';
}
.grace-fixed-msg-text {
    width: 500rpx;
    line-height: 36rpx;
    font-size: 26rpx;
    color: #fff;
    height: 36rpx;
    text-align: left;
    overflow: hidden;
}
</style>
